package com.leoandroid.tool.toolsbox;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;

import com.leoandroid.tool.toolsbox.largeread.R;
import com.leoandroid.tool.toolsbox.largeread.databinding.ActivityPolicyToolBinding;
import com.leoandroid.tool.toolsbox.largeread.utils.StatusBarUtil;
import com.leoandroid.tool.toolsbox.largeread.utils.ToolUtils;


public class PolicyToolActivity extends AppCompatActivity {
    private ActivityPolicyToolBinding bindingF;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        bindingF = ActivityPolicyToolBinding.inflate(getLayoutInflater());

        setContentView(bindingF.getRoot());
        if (ToolUtils.getHeightStatusBar(this) > 0) {
            findViewById(R.id.layout_padding).setPadding(
                    0,
                    ToolUtils.getHeightStatusBar(this),
                    0,
                    0
            );
        }
        ToolUtils.setStatusBarHomeTransparent(this);
        StatusBarUtil.setLightMode(this);
        Intent intent = getIntent();
        String title = intent.getStringExtra("TITLE").toString();
        String content = intent.getStringExtra("CONTENT").toString();

        bindingF.titleTv.setText(title);
        bindingF.webview.loadUrl(content);
        bindingF.backIv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}